package com.hz.copyingsystem.service.impl;

import com.hz.copyingsystem.vo.SelectedCopyingExamplesVo;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.common.utils.PageUtils;
import com.hz.common.utils.Query;

import com.hz.copyingsystem.dao.SelectedCopyingExamplesDao;
import com.hz.copyingsystem.entity.SelectedCopyingExamplesEntity;
import com.hz.copyingsystem.service.SelectedCopyingExamplesService;


@Service("selectedCopyingExamplesService")
public class SelectedCopyingExamplesServiceImpl extends ServiceImpl<SelectedCopyingExamplesDao, SelectedCopyingExamplesEntity> implements SelectedCopyingExamplesService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SelectedCopyingExamplesEntity> page = this.page(
                new Query<SelectedCopyingExamplesEntity>().getPage(params),
                new QueryWrapper<SelectedCopyingExamplesEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SelectedCopyingExamplesVo> queryExamples(Integer curPage, Integer pageSize, Long sid, String condition) {
        curPage = (curPage-1) * pageSize;
        return this.baseMapper.queryExamples(curPage, pageSize, sid, condition);
    }
    @Override
    public Integer queryExamplesNum(Long sid, String condition) {
        return this.baseMapper.queryExamplesNum(sid, condition);
    }

}